import { createRouter, createWebHashHistory } from 'vue-router'
import Landing from '../views/landing/index.vue'
import Home from '../views/home/index.vue'
import Community from '../views/Community/index.vue'
import Game from '../views/game/index.vue'
import My from '../views/my/index.vue'
import Landing2 from '../views/landing/index2.vue'
import Landing3 from '../views/landing/index3.vue'
import Gameinfo from '../views/home/gameinfo.vue'
import Classify from '../views/community/classify.vue'
import Set from '../views/my/set.vue'
import Edit from '../views/my/edit.vue'
const router = createRouter({
  history: createWebHashHistory(import.meta.env.BASE_URL),
  routes: [
    {
      path: '/',
      // redirect 路由重定向,当进入某个路由后，指定跳转到另一个路由中，通常在配置子路由的时候会使用到
      redirect: '/splash'
    },
    {
      path: '/home',
      name: 'home',
      component: Home,
      meta: {
        title: '首页'
      },
    },
    {
      path: '/community',
      name: 'community',
      component: Community,
      meta: {
        title: '社区'
      },
    },
    {
      path: '/game',
      name: 'game',
      component: Game,
      meta: {
        title: '游戏'
      },
    },
    {
      path: '/my',
      name: 'my',
      component: My,
      meta: {
        title: '我的'
      },
    },
    {
      path: '/gameinfo',
      name: 'gameinfo',
      component: Gameinfo,
      meta: {
        title: '资讯'
      },
    },
    {
      path: '/classify',
      name: 'classify',
      component: Classify,
      meta: {
        title: '分类'
      },
    },
    {
      path: '/set',
      name: 'set',
      component: Set,
      meta: {
        title: '设置'
      },
    },
    {
      path: '/edit',
      name: 'edit',
      component: Edit,
      meta: {
        title: '编辑'
      },
    },
    {
      path: '/splash',
      name: 'splash',
      meta: {
        title: '闪屏',
        hidden:true,
      },
      component:()=>import('../views/splash/index.vue')
    },
    
    {
      path: '/landing1',
      name: 'landing1',
      meta: {
        title: '引导页1',
        hidden:true,
      },
      component:()=>import('../views/landing/index.vue')
    },
    {
      path: '/landing2',
      name: 'landing2',
      meta: {
        title: '引导页2',
        hidden:true,
      },
      component:()=>import('../views/landing/index2.vue')
    },
    {
      path: '/landing3',
      name: 'landing3',
      meta: {
        title: '引导页3',
        hidden:true,
      },
      component:()=>import('../views/landing/index3.vue')
    },
    {
      path: '/login',
      name: 'login',
      meta: {
        title: '登录',
        hidden:true,
      },
      component:()=>import('../views/login/index.vue')
    },
    {
      path: '/enroll',
      name: 'enroll',
      meta: {
        title: '注册',
        hidden:true,
      },
      component:()=>import('../views/enroll/index.vue')
    },
    {
      path: '/setpsw',
      name: 'setpsw',
      meta: {
        title: '忘记密码',
        hidden:true,
      },
      component:()=>import('../views/setpsw/index.vue')
    },
  ],
})

export default router
